/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.support.a;

import android.content.Context;
import android.text.TextUtils.TruncateAt;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView.LayoutParams;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.qihoo.gamecenter.sdk.common.i.s;
import java.util.List;

public class a extends BaseAdapter {
    private Context a;
    private List b;

    public a(Context paramContext, List paramList) {
        this.a = paramContext;
        this.b = paramList;
    }

    public int getCount() {
        return ((this.b != null) ? this.b.size() : 0);
    }

    public String a(int paramInt) {
        if (this.b != null) {
            int i = this.b.size();
            if ((i > 0) && (paramInt >= 0) && (paramInt < i))
                return ((String) this.b.get(paramInt));
        }
        return null;
    }

    public long getItemId(int paramInt) {
        return paramInt;
    }

    public View getView(int paramInt, View paramView, ViewGroup paramViewGroup) {
        if (paramView == null)
            paramView = a();
        ((TextView) paramView).setText(a(paramInt));
        return paramView;
    }

    private View a() {
        TextView localTextView = new TextView(this.a);
        localTextView.setLayoutParams(new AbsListView.LayoutParams(-1, s.b(this.a, 43.0F)));
        localTextView.setSingleLine(true);
        localTextView.setTextColor(-13421773);
        localTextView.setTextSize(1, s.a(this.a, 13.7F));
        localTextView.setPadding(s.b(this.a, 15.0F), 0, s.b(this.a, 15.0F), 0);
        localTextView.setEllipsize(TextUtils.TruncateAt.MIDDLE);
        localTextView.setGravity(16);
        return localTextView;
    }
}